package aures.plugins;

import java.io.File;



public class Test {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		sysPlugin.initialize();
		Plugin plugin = null;
		final String mod_path = "/home/goundy/AuresOpenPoker/Jython/scripts/";
		
		File dir = new File(mod_path);
		String[] list = dir.list();

		for (String s:list){
			File script = new File(mod_path + s);
			if (script.isFile()){
				System.out.println("Loading " + s);
				try{
					plugin = new Plugin(mod_path + s);
					
					plugin.init();
					sysPlugin.runHooks(sysPlugin.HOOK_ON_RECEIVE);
					sysPlugin.runHooks(sysPlugin.HOOK_ON_GAME);
					sysPlugin.runHooks(sysPlugin.HOOK_AFTER_PARSE);
					
					plugin.clean();
					
					sysPlugin.runHooks(sysPlugin.HOOK_ON_RECEIVE);
					sysPlugin.runHooks(sysPlugin.HOOK_ON_GAME);
					sysPlugin.runHooks(sysPlugin.HOOK_AFTER_PARSE);
				
				}catch (Exception e){
					sysPlugin.printErr(plugin.getFilename() + "\n" + e.toString());
				}
			}
		}
	}

}
